﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HeadFirst._05.Singleton._02
{
    public class ChocolateBoiler
    {

        private bool empty;
        private bool boiled;

        public bool IsEmpty() => empty;
        public bool IsBoiled() => boiled;

        public ChocolateBoiler()
        {
            empty = true;
            boiled = false;
        }

        public void Fill()
        {
            if (IsEmpty())
            {
                empty = false;
                boiled = false;
                Console.WriteLine("加生可可");
            }

        }
        public void Drain()
        {
            if (!IsEmpty() && IsBoiled()) 
            {
                empty = true;
                Console.WriteLine("倒出来");
            }

        }

        public void boil()
        {
            if (!IsEmpty() && !IsBoiled())
            {
                boiled = true;
                Console.WriteLine("烧开");
            }

        }


    }
}
